package com.fz.service.impl;

import com.fz.entity.Region;
import com.fz.mapper.RegionMapper;
import com.fz.service.RegionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 存储区域名称与位置信息 服务实现类
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Service
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService {
    @Override
    public Boolean add(String name, String address) {
        return this.save(new Region(name,address));
    }

    @Override
    public Boolean update(Long id, String name, String address) {
        return this.updateById(new Region(name,address));
    }

    @Override
    public Boolean del(Long id) {
        return this.removeById(id);
    }

    @Override
    public boolean dele(Long id, boolean status) {
        return this.updateById(new Region(id,status));
    }
}
